package hr_project.hr.biz.Emp;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import hr_project.hr.dao.emp.IEmpMoveDao;
import hr_project.hr.entity.EmpMove;
import hr_project.hr.entity.Empmove_result;
import hr_project.hr.util.QueryEmpMove;
import hr_project.hr.util.pagebean;

@Service("empmovebiz")
public class EmpMoveBizImp implements IEmpMoveBiz {
	
	@Autowired
	private IEmpMoveDao dao;

	public IEmpMoveDao getDao() {
		return dao;
	}

	public void setDao(IEmpMoveDao dao) {
		this.dao = dao;
	}

	@Override
	public void addEmpMove(EmpMove emo) {
		// TODO Auto-generated method stub
		dao.addEmpMove(emo);
	}

	@Override
	public void modEmpMove(EmpMove emo) {
		// TODO Auto-generated method stub
		dao.modEmpMove(emo);
	}

	@Override
	public EmpMove getById(long id) {
		// TODO Auto-generated method stub
		return dao.getById(id);
	}

	@Override
	public List<EmpMove> getByCheck(long checkid) {
		// TODO Auto-generated method stub
		return dao.getByCheck(checkid);
	}

	@Override
	public List<EmpMove> getByCreator(long creaid,int page,int pagesize) {
		// TODO Auto-generated method stub
		return dao.getByCreator(creaid, page, pagesize);
	}

	@Override
	public void delEmpMove(long logid) {
		// TODO Auto-generated method stub
		dao.delEmpMove(logid);
	}

	@Override
	public pagebean getByPage(QueryEmpMove query, int page) {
		// TODO Auto-generated method stub
		
		pagebean pb=new pagebean();
		pb.setList(dao.getAll(query, page, pb.getPageSize()));
		pb.setCurrpage(page);
		pb.setTotalRow(dao.getRowCount(query));
		
		return pb;
	}

	@Override
	public List<EmpMove> getAll(int page, int pagesize, long logid) {
		// TODO Auto-generated method stub
		return dao.getByCreator(logid, page, pagesize);
	}

	@Override
	public int getCount(long logid) {
		// TODO Auto-generated method stub
		return dao.getRowCountBylogid(logid);
	}

	@Override
	public int getCountBylogid(long logid) {
		// TODO Auto-generated method stub
		return dao.getRowCountBylogid(logid);
	}

	@Override
	public void addRes(Empmove_result res) {
		// TODO Auto-generated method stub
		dao.addResult(res);
	}

	@Override
	public void addEmpMove_arrive(EmpMove emo) {
		// TODO Auto-generated method stub
		dao.addEmpMove_arrive(emo);
	}

	
	
	
}
